<script setup>
import { Document, Menu as IconMenu, Location, Setting} from '@element-plus/icons-vue'

const handleOpen = (key, keyPath) => {
  console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>


<template>
    <el-row class="side-bar">
      <el-col :span="24">
        <div style="display: flex; align-items: center;">
          <div><img src="../assets/favicon.png" style="height: 60px;padding: 5px;" alt=""></div>
          <h3>园区管理系统</h3>
        </div>
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
        <router-link to="/home"> 
          <el-menu-item index="1">
            <el-icon><icon-menu /></el-icon>
            <span>可视化界面</span>
          </el-menu-item>
        </router-link>

          <el-sub-menu index="2">
            <template #title>
              <el-icon><location /></el-icon>
              <span>园区管理</span>
            </template>

              <router-link to="/park/building">
                <el-menu-item index="2-1">楼宇管理</el-menu-item>
              </router-link>
              <router-link to="/park/person">
                <el-menu-item index="2-2">人员管理</el-menu-item>
              </router-link>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><location /></el-icon>
              <span>车辆管理</span>
            </template>
              <router-link to="/car/carMonth">
                <el-menu-item index="3-1">区域管理</el-menu-item>
              </router-link>
              <router-link to="/car/carRule">
                <el-menu-item index="3-2">停车缴费</el-menu-item>
              </router-link>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon><location /></el-icon>
              <span>角色管理</span>
            </template>
              <router-link to="/role/part">
                <el-menu-item index="4-1">部门管理</el-menu-item>
              </router-link>
              <router-link to="/role/employee">
                <el-menu-item index="4-2">员工管理</el-menu-item>
              </router-link>
          </el-sub-menu>
        </el-menu>
      </el-col>
    </el-row>
</template>

<style lang="scss" scoped>
.side-bar {
  height: 100%;
  background-color: #fff;
}
</style>
  
